/*
 * Created by Administrator on 2017/3/31.
 */

var AccountMes = React.createClass({
    getDefaultProps: function() {
        return{
            AccType:0

        }
    },
    componentDidMount:function(){

    },
    render: function () {
        if(!this.props.AccType){
            var UncollectedIncome = Number(this.props.UncollectedIncome), _moreOver = false;
            if(UncollectedIncome < 10000){
                UncollectedIncome = UFormatter.formatMoney(UncollectedIncome,2);
            }else{
                UncollectedIncome = UFormatter.formatMoney(UncollectedIncome / 10000,2);
                _moreOver = true;
            }
            return(
                <ul className="clearfix">
                    <li><span className="span fc-main"><strong>{UFormatter.formatMoney(Number(this.props.UncollectedPrincipal),2)}</strong>元</span><p className="fc-light"> 待回收收益</p></li>
                    <li><span className="span fc-dark"><strong>{UncollectedIncome}</strong>{_moreOver?"万元":"元"}</span><p className="fc-light"> 待回收本金</p></li>
                    <li><span className="span fc-dark"><strong>{UFormatter.formatMoney(Number(this.props.TotalIncome),2)}</strong>元</span><p className="fc-light"> 账户累计收益</p></li>
                </ul>
            )
        }else {
            var UncollectedPrincipal = Number(this.props.UncollectedPrincipal), _moreOver = false;
            if(UncollectedPrincipal < 10000){
                UncollectedPrincipal = UFormatter.formatMoney(UncollectedPrincipal,2);
            }else{
                UncollectedPrincipal = UFormatter.formatMoney(UncollectedPrincipal / 10000,2);
                _moreOver = true;
            }
            return(
                <ul className="clearfix">
                    <li><span className="span fc-main"><strong>{UncollectedPrincipal}</strong>{_moreOver?"万元":"元"}</span><p className="fc-light"> 成功融资总额</p></li>
                    <li><span className="span fc-dark"><strong>{UFormatter.formatMoney(Number(this.props.UncollectedIncome),2)}</strong>元</span><p className="fc-light"> 待还本息</p></li>
                    <li><span className="span fc-dark"><strong>{UFormatter.formatMoney(Number(this.props.TotalIncome),2)}</strong>元</span><p className="fc-light"> 已还本息</p></li>
                </ul>
            )
        }


    }
})

module.exports = AccountMes;